<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        li{
            list-style: none;
        }
        .open{
            display: flex;
            
        }
       .open>div{
            width: 150px;
            background: yellow;
            line-height: 50px;
            text-align: center;
            border-right: 1px solid red;
            position: relative;
        }
       .box{
           position: absolute;
           top: 50px;
           left: 0;
           width: 150px;
           /* display: block !important; */
           display: none;
       }
       .show{
           display: block;
       }
        .box>li{
        
          width: 150px;
          line-height: 30px;
          background: gold;
         
        }
    </style>
</head>
<body>
    <div class="open">
  
        <div>商品2
            <ul class="box">
                <li>选项1</li>
                <li>选项2</li>
                <li>选项3</li>
            </ul>
        </div>
        <div>商品3
            <ul class="box">
                <li>选项1</li>
                <li>选项2</li>
                <li>选项3</li>
            </ul>
        </div>
        <div>商品4</div>
        <div>商品5</div>
    </div>
    <script>
        let div=document.querySelectorAll('.open>div')
div.forEach(function(item,i){
    item.addEventListener('mouseover',function(){
        if(item.children.length===1){
            item.children[0].classList.add('show')
        }
    })
    item.addEventListener('mouseout',function(){
        if(item.children.length===1){
            item.children[0].classList.remove('show')
        }
    })
})
    </script>
</body>
</html>